﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SimpleInOutControl.DBModels
{
    /// <summary>
    /// 进出记录
    /// </summary>
    [SugarTable(TableDescription = "进出记录")]
    [SugarIndex("Index_{table}_DeviceID", nameof(DeviceID), OrderByType.Asc)]
    [SugarIndex("Index_{table}_PersonID", nameof(PersonID), OrderByType.Asc)]
    [SugarIndex("Index_{table}_TriggerTime", nameof(TriggerTime), OrderByType.Asc)]
    public class InOutRecordData
    {
        /// <summary>
        /// ID
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "ID")]
        public int? ID { get; set; }
        /// <summary>
        /// 设备ID
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "设备ID")]
        public int? DeviceID { get; set; }
        /// <summary>
        /// 人员ID
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "人员ID")]
        public Guid? PersonID { get; set; }
        /// <summary>
        /// 人员姓名
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "人员姓名")]
        public string? PersonName { get; set; }
        /// <summary>
        /// 抓拍图片路径
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "抓拍图片路径")]
        public string? PicturePath { get; set; }
        /// <summary>
        /// 触发时间
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "触发时间")]
        public DateTime? TriggerTime { get; set; } = DateTime.Now;
        /// <summary>
        /// 处理时间
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "处理时间")]
        public DateTime? ProcessingTime { get; set; } = DateTime.Now;
        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDataType = "text", ColumnDescription = "备注")]
        public string? Notes { get; set; }
    }
}
